import type { Query } from 'mongoose';
export type Unpromise<T> = T extends Promise<infer U> ? U : T;
export type Dearray<T> = T extends (infer U)[] ? U : never;
export type NotNullish<T> = T extends null | undefined ? never : T;
export type ExtractQuery<QueryType> = QueryType extends Query<
  unknown,
  unknown,
  unknown,
  infer T,
  any
>
  ? T
  : never;
